PROJECT( jolfs )

## Minimum CMake version required
CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )

### Include directories
INCLUDE_DIRECTORIES( ./inc )

### External libraries
INCLUDE( FindBoost )
SET( Boost_USE_MULTITHREADED ON )
SET( Boost_USE_STATIC_LIBS   ON )
FIND_PACKAGE( Boost REQUIRED COMPONENTS filesystem program_options )

### Project files
FILE( GLOB_RECURSE SOURCES ./src/*.cpp )
FILE( GLOB_RECURSE HEADERS ./inc/*.h   )

### Compiler configuration
ADD_LIBRARY( jolfs SHARED ${SOURCES} ${HEADERS} )

### Linker configuration
TARGET_LINK_LIBRARIES( jolfs ${Boost_LIBRARIES} )

### Output properties
SET_TARGET_PROPERTIES( jolfs PROPERTIES LINKER_LANGUAGE CXX )

SET_TARGET_PROPERTIES( jolfs PROPERTIES DEBUG_POSTFIX   "d" )
SET_TARGET_PROPERTIES( jolfs PROPERTIES RELEASE_POSTFIX ""  )

SET_TARGET_PROPERTIES( jolfs PROPERTIES PREFIX  "lib"  )

SET_TARGET_PROPERTIES( jolfs PROPERTIES OUTPUT_NAME "jolfs" )

### Tests
OPTION( BUILD_TESTS "Build unit tests" ON )
IF( BUILD_TESTS )
  ADD_SUBDIRECTORY( test )
ENDIF( BUILD_TESTS )
